package org.room402.chat.process;

import org.reactivestreams.Publisher;
import org.room402.entity.chat.MessageEvent;
import org.springframework.web.reactive.socket.WebSocketSession;
import reactor.core.publisher.Mono;

/**
 * 消息处理器接口
 */
public interface MessageProcess {
    /**
     * 消息类型匹配
     */
    boolean actionMatch(MessageEvent event, WebSocketSession session);

    /**
     * 如果消息类型匹配通过 会进入 驳回匹配
     */
    boolean rejectMatch(MessageEvent event, WebSocketSession session);

    /**
     * 不驳回进入process
     */
    Publisher<Void> process(MessageEvent event, WebSocketSession session);

    /**
     * 驳回进入reject
     */
    Publisher<Void> reject(MessageEvent event, WebSocketSession session);
}
